<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>2.跨域问题_限制cookie访问</title>
</head>
<body>
    <h2>君不见黄河之水天上来</h2>
    <button onclick="showDOM()">获取页面2的cookie</button>

    <!-- <iframe id="framePage" src="http://127.0.0.1:5500/demo.html" frameborder="1"></iframe> -->
    <iframe id="framePage" src="https://www.baidu.com" frameborder="1"></iframe>

    <script type="text/javascript">
        function showDOM(){
            // 打印的是当前源的cookie,不是百度的
            console.log(document.cookie);
        }
    </script>
</body>
</html>